package com.yakaten.listener;


import java.util.Timer;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.yakaten.service.AmazonPriceRunner;
import com.yakaten.service.KakakuPriceRunner;
import com.yakaten.service.YahooPriceRunner;
import com.yakaten.utils.DeleteFileTask;

public class KakakuPriceRunTaskListenser implements ServletContextListener  {

	Timer deleteFileTime = new Timer(true);

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		deleteFileTime.cancel();
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		new KakakuPriceRunner().start();
		new AmazonPriceRunner().start();
		new YahooPriceRunner().start();
//
//		deleteFileTime.schedule(new DeleteFileTask(), 0, 1000*60*60*24*7);
	}

}
